{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "fb9d7740",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 获取数据\n",
    "import pandas as pd\n",
    "data = pd.read_csv('gaze.csv')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "551b5dc5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>88150.825638</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>88150.827729</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>88150.829663</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>88150.866015</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>88150.869620</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87437</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87438</th>\n",
       "      <td>88443.697570</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87439</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87440</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87441</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>87442 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "0        88150.825638            2    0.915197    0.493612    0.398950   \n",
       "1        88150.827729            2    0.915197    0.493561    0.399305   \n",
       "2        88150.829663            2    0.915197    0.493570    0.399542   \n",
       "3        88150.866015            3    0.922197    0.492592    0.398705   \n",
       "4        88150.869620            3    0.922197    0.492635    0.398814   \n",
       "...               ...          ...         ...         ...         ...   \n",
       "87437    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "87438    88443.697570         8788    0.948733    0.407552    0.414731   \n",
       "87439    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "87440    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "87441    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "0           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "1           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "2      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "3      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "4           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                   ...              ...              ...   \n",
       "87437        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "87438   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "87439  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "87440       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "87441  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "       gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "0          -295.071057         20.000000  ...        -20.000000   \n",
       "1          -294.819200         20.000000  ...        -20.000000   \n",
       "2          -294.874516         20.000000  ...        -20.000000   \n",
       "3          -298.233245         20.000000  ...        -20.000000   \n",
       "4          -298.471253         20.000000  ...        -20.000000   \n",
       "...                ...               ...  ...               ...   \n",
       "87437     -2777.243340         19.888755  ...        -20.707271   \n",
       "87438     -2628.637408         19.888755  ...        -20.707271   \n",
       "87439     -2647.420719         19.888755  ...        -20.707271   \n",
       "87440     -2499.428189         19.888755  ...        -20.707271   \n",
       "87441     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "       gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "0            0.062883        0.025100        0.997705        -39.934928   \n",
       "1            0.062883        0.025100        0.997705        -39.934928   \n",
       "2            0.062883        0.025100        0.997705        -39.934928   \n",
       "3            0.060717        0.025220        0.997836        -39.934928   \n",
       "4            0.060717        0.025220        0.997836        -39.934928   \n",
       "...               ...             ...             ...               ...   \n",
       "87437       -0.110854        0.041843        0.992955        -37.372594   \n",
       "87438       -0.110854        0.041843        0.992955        -37.372594   \n",
       "87439       -0.111009        0.041794        0.992940        -37.372594   \n",
       "87440       -0.111009        0.041794        0.992940        -37.372594   \n",
       "87441       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "       eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "0             14.997919        -20.075283       -0.150041        0.234536   \n",
       "1             14.997919        -20.075283       -0.150243        0.234115   \n",
       "2             14.997919        -20.075283       -0.150210        0.233747   \n",
       "3             14.997919        -20.075283       -0.149814        0.233510   \n",
       "4             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                 ...               ...             ...             ...   \n",
       "87437         14.763454        -23.294339       -0.130868        0.093021   \n",
       "87438         14.763454        -23.294339       -0.132037        0.091860   \n",
       "87439         14.763454        -23.294339       -0.132037        0.091860   \n",
       "87440         14.763454        -23.294339       -0.133311        0.091656   \n",
       "87441         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "       gaze_normal1_z  \n",
       "0            0.960458  \n",
       "1            0.960530  \n",
       "2            0.960624  \n",
       "3            0.960744  \n",
       "4            0.960831  \n",
       "...               ...  \n",
       "87437        0.987026  \n",
       "87438        0.986979  \n",
       "87439        0.986979  \n",
       "87440        0.986827  \n",
       "87441        0.986974  \n",
       "\n",
       "[87442 rows x 21 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# (1)\n",
    "data1 = data.loc[data['confidence'] >= 0.9]\n",
    "data1['confidence']\n",
    "data1=data1.reset_index(drop=True)\n",
    "data1.to_csv('1.csv')\n",
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b6e76cab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>88150.825638</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>88150.827729</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>88150.829663</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>88150.866015</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>88150.869620</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86180</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86181</th>\n",
       "      <td>88443.697570</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86182</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86183</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86184</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86185 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "0        88150.825638            2    0.915197    0.493612    0.398950   \n",
       "1        88150.827729            2    0.915197    0.493561    0.399305   \n",
       "2        88150.829663            2    0.915197    0.493570    0.399542   \n",
       "3        88150.866015            3    0.922197    0.492592    0.398705   \n",
       "4        88150.869620            3    0.922197    0.492635    0.398814   \n",
       "...               ...          ...         ...         ...         ...   \n",
       "86180    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "86181    88443.697570         8788    0.948733    0.407552    0.414731   \n",
       "86182    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "86183    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "86184    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "0           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "1           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "2      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "3      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "4           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                   ...              ...              ...   \n",
       "86180        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "86181   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "86182  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "86183       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "86184  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "       gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "0          -295.071057         20.000000  ...        -20.000000   \n",
       "1          -294.819200         20.000000  ...        -20.000000   \n",
       "2          -294.874516         20.000000  ...        -20.000000   \n",
       "3          -298.233245         20.000000  ...        -20.000000   \n",
       "4          -298.471253         20.000000  ...        -20.000000   \n",
       "...                ...               ...  ...               ...   \n",
       "86180     -2777.243340         19.888755  ...        -20.707271   \n",
       "86181     -2628.637408         19.888755  ...        -20.707271   \n",
       "86182     -2647.420719         19.888755  ...        -20.707271   \n",
       "86183     -2499.428189         19.888755  ...        -20.707271   \n",
       "86184     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "       gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "0            0.062883        0.025100        0.997705        -39.934928   \n",
       "1            0.062883        0.025100        0.997705        -39.934928   \n",
       "2            0.062883        0.025100        0.997705        -39.934928   \n",
       "3            0.060717        0.025220        0.997836        -39.934928   \n",
       "4            0.060717        0.025220        0.997836        -39.934928   \n",
       "...               ...             ...             ...               ...   \n",
       "86180       -0.110854        0.041843        0.992955        -37.372594   \n",
       "86181       -0.110854        0.041843        0.992955        -37.372594   \n",
       "86182       -0.111009        0.041794        0.992940        -37.372594   \n",
       "86183       -0.111009        0.041794        0.992940        -37.372594   \n",
       "86184       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "       eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "0             14.997919        -20.075283       -0.150041        0.234536   \n",
       "1             14.997919        -20.075283       -0.150243        0.234115   \n",
       "2             14.997919        -20.075283       -0.150210        0.233747   \n",
       "3             14.997919        -20.075283       -0.149814        0.233510   \n",
       "4             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                 ...               ...             ...             ...   \n",
       "86180         14.763454        -23.294339       -0.130868        0.093021   \n",
       "86181         14.763454        -23.294339       -0.132037        0.091860   \n",
       "86182         14.763454        -23.294339       -0.132037        0.091860   \n",
       "86183         14.763454        -23.294339       -0.133311        0.091656   \n",
       "86184         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "       gaze_normal1_z  \n",
       "0            0.960458  \n",
       "1            0.960530  \n",
       "2            0.960624  \n",
       "3            0.960744  \n",
       "4            0.960831  \n",
       "...               ...  \n",
       "86180        0.987026  \n",
       "86181        0.986979  \n",
       "86182        0.986979  \n",
       "86183        0.986827  \n",
       "86184        0.986974  \n",
       "\n",
       "[86185 rows x 21 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# (2)\n",
    "mean1=data1['norm_pos_x'].mean()\n",
    "mean2=data1['norm_pos_y'].mean()\n",
    "std1=data1['norm_pos_x'].std()\n",
    "std2=data1['norm_pos_y'].std()\n",
    "data2=data1.loc[data1['norm_pos_x']<mean1+3*std1]\n",
    "data2=data2.loc[data1['norm_pos_x']>mean1-3*std1]\n",
    "data2=data2.loc[data1['norm_pos_y']<mean2+3*std2]\n",
    "data2=data2.loc[data1['norm_pos_y']>mean2-3*std2]\n",
    "data2=data2.reset_index(drop=True)\n",
    "data2.to_csv('2.csv')\n",
    "data2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a53d39d6",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\wwlwx\\AppData\\Local\\Temp\\ipykernel_11980\\3014640781.py:14: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  data3['gaze_timestamp'].loc[j] = Timestyle\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1970-01-01 08:00:00</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1970-01-01 08:00:01</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1970-01-01 08:00:02</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1970-01-01 08:00:03</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1970-01-01 08:00:04</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86180</th>\n",
       "      <td>1970-01-02 07:56:20</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86181</th>\n",
       "      <td>1970-01-02 07:56:21</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86182</th>\n",
       "      <td>1970-01-02 07:56:22</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86183</th>\n",
       "      <td>1970-01-02 07:56:23</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86184</th>\n",
       "      <td>1970-01-02 07:56:24</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86185 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "0      1970-01-01 08:00:00            2    0.915197    0.493612    0.398950   \n",
       "1      1970-01-01 08:00:01            2    0.915197    0.493561    0.399305   \n",
       "2      1970-01-01 08:00:02            2    0.915197    0.493570    0.399542   \n",
       "3      1970-01-01 08:00:03            3    0.922197    0.492592    0.398705   \n",
       "4      1970-01-01 08:00:04            3    0.922197    0.492635    0.398814   \n",
       "...                    ...          ...         ...         ...         ...   \n",
       "86180  1970-01-02 07:56:20         8788    0.995336    0.407831    0.413470   \n",
       "86181  1970-01-02 07:56:21         8788    0.948733    0.407552    0.414731   \n",
       "86182  1970-01-02 07:56:22         8788    0.945284    0.407467    0.414705   \n",
       "86183  1970-01-02 07:56:23         8788    0.945284    0.407160    0.415340   \n",
       "86184  1970-01-02 07:56:24         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "0           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "1           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "2      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "3      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "4           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                   ...              ...              ...   \n",
       "86180        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "86181   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "86182  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "86183       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "86184  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "       gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "0          -295.071057         20.000000  ...        -20.000000   \n",
       "1          -294.819200         20.000000  ...        -20.000000   \n",
       "2          -294.874516         20.000000  ...        -20.000000   \n",
       "3          -298.233245         20.000000  ...        -20.000000   \n",
       "4          -298.471253         20.000000  ...        -20.000000   \n",
       "...                ...               ...  ...               ...   \n",
       "86180     -2777.243340         19.888755  ...        -20.707271   \n",
       "86181     -2628.637408         19.888755  ...        -20.707271   \n",
       "86182     -2647.420719         19.888755  ...        -20.707271   \n",
       "86183     -2499.428189         19.888755  ...        -20.707271   \n",
       "86184     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "       gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "0            0.062883        0.025100        0.997705        -39.934928   \n",
       "1            0.062883        0.025100        0.997705        -39.934928   \n",
       "2            0.062883        0.025100        0.997705        -39.934928   \n",
       "3            0.060717        0.025220        0.997836        -39.934928   \n",
       "4            0.060717        0.025220        0.997836        -39.934928   \n",
       "...               ...             ...             ...               ...   \n",
       "86180       -0.110854        0.041843        0.992955        -37.372594   \n",
       "86181       -0.110854        0.041843        0.992955        -37.372594   \n",
       "86182       -0.111009        0.041794        0.992940        -37.372594   \n",
       "86183       -0.111009        0.041794        0.992940        -37.372594   \n",
       "86184       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "       eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "0             14.997919        -20.075283       -0.150041        0.234536   \n",
       "1             14.997919        -20.075283       -0.150243        0.234115   \n",
       "2             14.997919        -20.075283       -0.150210        0.233747   \n",
       "3             14.997919        -20.075283       -0.149814        0.233510   \n",
       "4             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                 ...               ...             ...             ...   \n",
       "86180         14.763454        -23.294339       -0.130868        0.093021   \n",
       "86181         14.763454        -23.294339       -0.132037        0.091860   \n",
       "86182         14.763454        -23.294339       -0.132037        0.091860   \n",
       "86183         14.763454        -23.294339       -0.133311        0.091656   \n",
       "86184         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "       gaze_normal1_z  \n",
       "0            0.960458  \n",
       "1            0.960530  \n",
       "2            0.960624  \n",
       "3            0.960744  \n",
       "4            0.960831  \n",
       "...               ...  \n",
       "86180        0.987026  \n",
       "86181        0.986979  \n",
       "86182        0.986979  \n",
       "86183        0.986827  \n",
       "86184        0.986974  \n",
       "\n",
       "[86185 rows x 21 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# (3)\n",
    "import csv\n",
    "import time\n",
    "with open('2.csv','r') as csvfile:\n",
    "    reader = csv.reader(csvfile)\n",
    "    column = [row[0] for row in reader]\n",
    "column\n",
    "column.pop(0)\n",
    "j = 0\n",
    "data3 = data2.copy()\n",
    "for i in column:\n",
    "    timeArray = time.localtime(float(i))\n",
    "    Timestyle = time.strftime(\"%Y-%m-%d %H:%M:%S\", timeArray)\n",
    "    data3['gaze_timestamp'].loc[j] = Timestyle\n",
    "    j = j+1\n",
    "data3\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f94d1db0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "427.62610766083765"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# (4)\n",
    "length = len(data['gaze_timestamp'])\n",
    "time = data['gaze_timestamp'][length-1] - data['gaze_timestamp'][0] \n",
    "a = length /time\n",
    "a\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a3786c8b-73cc-4a49-bc37-5e6dea372286",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[88150.77678, 88150.787485, 88150.79840649999, 88150.80726949999, 88150.818051, 88150.827729, 88150.83957499999, 88150.84950499999, 88150.85956099999, 88150.86962, 88150.87958449998, 88150.88999649999, 88150.8995115, 88150.90939799999, 88150.91942349999, 88150.9275245, 88150.93855949999, 88150.947523, 88150.95950249999, 88150.96950749999, 88150.97952299999]\n"
     ]
    }
   ],
   "source": [
    "# (5)\n",
    "list = []\n",
    "point = 1\n",
    "frequent = 0.01\n",
    "time1 = data['gaze_timestamp'][0]\n",
    "list.append(data['gaze_timestamp'][0])\n",
    "i = 0\n",
    "while len(list) < 21 :\n",
    "    diff = abs(float(data['gaze_timestamp'][i + 1] - time1 - frequent))\n",
    "    if diff >= point:\n",
    "        diff = 1\n",
    "        list.append(data['gaze_timestamp'][i])\n",
    "        time1 = data['gaze_timestamp'][i]\n",
    "    i += 1\n",
    "    point = diff\n",
    "print(list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "591d3fc3-7977-4966-b7bb-046bd06bca56",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
